/* 
 * File:   QGLThread.h
 * Author: jcrada
 *
 * Created on December 3, 2008, 3:12 PM
 */

#ifndef _QGLTHREAD_H
#define	_QGLTHREAD_H
#include <QtCore/QThread>
#include "QGLRenderer.h"


#include <QtOpenGL/QGLWidget>
#include <QtGui/QWidget>

namespace jcrada {

    class QGLRendererThread : public QThread {
        Q_OBJECT
    public slots:
        virtual void notify( );
        virtual void stop( );
    signals:
        void render( );
    private:
        QGLRenderer* _renderer;
        void _init( );
    public:
        static int main( int argc, char** argv );
        QGLRendererThread( );
        QGLRendererThread( QGLRenderer* renderer );
        virtual ~QGLRendererThread( );
        virtual void run( );
        virtual void setRenderer( QGLRenderer* renderer );

        virtual QGLRenderer& getRenderer( ) const {
            return *this->_renderer;
        }

    };
}
#endif	/* _QGLTHREAD_H */

